package com.atguigu.registration.hosp.controller;

import com.atguigu.registration.common.result.Result;
import com.atguigu.registration.hosp.service.DepartmentService;
import com.atguigu.registration.vo.hosp.DepartmentVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: Jiang Yizhi
 * @Date: 2022/4/28 5:32 PM
 */
@RestController
@RequestMapping("/admin/hosp/department")
//@CrossOrigin
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    /** 根据医院编号查询科室列表 */
    @ApiOperation(value = "根据医院编号查询科室列表" )
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode) {
        List<DepartmentVo> list = departmentService.findDeptTree(hoscode);
        return Result.ok(list);
    }
}
